using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class BattleEnemyStatus : MonoBehaviour
{
	public BattleActiveEnemy ActiveEnemy;

	[SerializeField]
	private Image HealthBar;

	[SerializeField]
	private Image SpareBar;

	[SerializeField]
	private TextMeshProUGUI Health_Text;

	[SerializeField]
	private TextMeshProUGUI Spare_Text;

	public TextMeshProUGUI EnemyName;

	public void UpdateStatusGraphics()
	{
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		((Object)((Component)this).gameObject).name = ActiveEnemy.EnemyInBattle.EnemyName + "_status";
		HealthBar.fillAmount = ActiveEnemy.Enemy_Health / ActiveEnemy.Enemy_MaxHealth;
		SpareBar.fillAmount = ActiveEnemy.Enemy_MercyAmount / 100f;
		((TMP_Text)Health_Text).text = Mathf.Ceil(ActiveEnemy.Enemy_Health / ActiveEnemy.Enemy_MaxHealth * 100f) + "%";
		((TMP_Text)Spare_Text).text = ActiveEnemy.Enemy_MercyAmount + "%";
		((Graphic)EnemyName).color = Color.white;
		if (ActiveEnemy.Enemy_MercyAmount >= 100f)
		{
			((Graphic)EnemyName).color = Color.yellow;
		}
		if (ActiveEnemy.Enemy_IsTired)
		{
			((Graphic)EnemyName).color = Color.blue;
		}
		((TMP_Text)EnemyName).text = ActiveEnemy.EnemyInBattle.EnemyName;
	}
}
